package com.tommy.ddp.definition
{
	import com.tommy.ddp.grid.skin.BarrierGridSkin;
	import com.tommy.ddp.grid.skin.DoubleGlassGridSkin;
	import com.tommy.ddp.grid.skin.EmptyGridSkin;
	import com.tommy.ddp.grid.skin.GlassGridSkin;
	import com.tommy.ddp.grid.skin.IGridSkin;
	import com.tommy.ddp.grid.skin.NormalGridSkin;
	import com.tommy.ddp.grid.skin.WireNetGridSkin;

	public class GridSkinFactory
	{
		public static const NORMAL:uint = 0;
		public static const GLASS:uint = 1;
		public static const DOUBLE_GLASS:uint = 2;
		public static const BARRIRE:uint = 3;
		/**
		 * 铁丝网
		 */		
		public static const WIRE_NET:uint = 4;
		/**
		 * 中空的 —— 处理思路是，如果发现中空的，就把这个删了，不记录但把他上下两个格子用connectPoint连接起来
		 * 寻路的时候等于可以直接跳过这个（可能多个）空的地方
		 */		
		public static const EMPTY:uint = 5;
		
		public function GridSkinFactory()
		{
		}
		
		public static function getGridSkin(type:uint):IGridSkin
		{
			var gridSkin:IGridSkin;
			if(type == NORMAL)
				gridSkin = new NormalGridSkin();
			else if(type == GLASS)
				gridSkin = new GlassGridSkin();
			else if(type == DOUBLE_GLASS)
				gridSkin = new DoubleGlassGridSkin();
			else if(type == BARRIRE)
				gridSkin = new BarrierGridSkin();
			else if(type == WIRE_NET)
				gridSkin = new WireNetGridSkin();
			else if(type == EMPTY)
				gridSkin = new EmptyGridSkin();
			
			return gridSkin;
		}
	}
}